<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<form action="">
		<button type="submit">发送</button>
	</form>
	 
	<script>
		const socket = new WebSocket('ws://localhost:3000') 
		socket.addEventListener('open', function(event){
			socket.send('Hello Server!')
		})

		socket.addEventListener('message', function(event){
			console.log('message from server', event.data)
		})
	</script>
</body>
</html>